# -*- coding: UTF-8 -*-
# __author__ : RobbieHan
# __data__  : 2017/10/21

import xadmin

from .models import Category, News, News2User


class CategoryAdmin(object):
    list_display = ['id','name','sort']
    list_filter = ['id','name','sort']

xadmin.site.register(Category,CategoryAdmin)

class NewsAdmin(object):
    list_display = ['id','title','content','category', 'author','createdate']
    list_filter = ['id','title','content','category', 'author','createdate']

xadmin.site.register(News, NewsAdmin)


class News2UserAdmin(object):
    list_display = ['id','news', 'user', 'isreaded']
    list_filter = ['id','news', 'user', 'isreaded']

xadmin.site.register(News2User, News2UserAdmin)

